Skip to content

docs: update Vuex guide for namespaced option #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2018

Conversation

cpxPratik
Copy link
Contributor

No description provided.

Copy link
Member

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some feedback, thanks for the contribution!

import Vuex from 'vuex'
import MyComponent from '../../../src/components/MyComponent'
import mymodule from '../../../src/store/mymodule'
import myModule from '../../../src/store/myModule'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this, fits the common convention of camel casing modules

@@ -241,10 +239,11 @@ describe('MyComponent.vue', () => {

store = new Vuex.Store({
modules: {
mymodule: {
myModule: {
namespaced: true, // If store/myModule is namespaced https://vuex.vuejs.org/guide/modules.html#namespacing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary. I think the examples should have as little noise as possible. Since the user is testing their modules, we can assume they know if they namespaced it or not. Since the focus of this guide and repo is the test setup/assertions, not Vuex and the Vuex API, I don't think this should be included.

@eddyerburgh
Copy link
Member

Thanks for the PR, I agree with @lmiller1990

Could you also update the example repo to match your changes—https://github.com/eddyerburgh/vue-test-utils-vuex-example

@cpxPratik
Copy link
Contributor Author

Updated based on comment, also there is a PR on the mentioned example repo to reflect changes.

Copy link
Member

@eddyerburgh eddyerburgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@eddyerburgh eddyerburgh merged commit 6dcfc4f into vuejs:dev Jun 10, 2018
@cpxPratik cpxPratik deleted the update-vuex-docs branch June 11, 2018 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants